package com.spring.application;

import com.spring.entity.Book;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringApplication_3 {

    //Bean之间的依赖
    @Test
    public void getBeanscope(){
        ApplicationContext context = new ClassPathXmlApplicationContext("springIOC-conf-3.xml");
        Book book1 = context.getBean("book", Book.class);
        Book book2 = context.getBean("book", Book.class);
        System.out.println(book1 == book2);
    }
}
